﻿using WeDonekRpc.Helper.Validate;
namespace Shop.RemoteModel.Advert.Model
{
    public class AdvertSet
    {
        /// <summary>
        /// 标题
        /// </summary>
        [LenValidate("shop.advert.title.len", 0, 100)]
        public string Title { get; set; }

        /// <summary>
        /// 图片链接
        /// </summary>
        [LenValidate("shop.advert.img.src.len", 0, 255)]
        [FormatValidate("shop.advert.img.src.error", ValidateFormat.图片URI)]
        public string ImgSrc { get; set; }

        /// <summary>
        /// 排序号
        /// </summary>
        [NumValidate("shop.advert.sort.error", 1)]
        public int Sort { get; set; }

        /// <summary>
        /// 关联ID
        /// </summary>
        [NumValidate("shop.advert.relation.id.error", 0)]
        public long RelationId { get; set; }

        /// <summary>
        /// 关联类型(字典)
        /// </summary>
        [EnumValidate("shop.advert.relation.type.error", typeof(AdvertRelationType))]
        public AdvertRelationType RelationType { get; set; }

        /// <summary>
        /// 投放开始
        /// </summary>
        [TimeValidate("shop.advert.putIn.begin.time.error", TimeFormat.分, 0)]
        public DateTime? PutInBegin { get; set; }

        /// <summary>
        /// 投放结束
        /// </summary>
        [TimeValidate("shop.advert.putIn.end.time.error", TimeFormat.分, 0)]
        public DateTime? PutInEnd { get; set; }

        /// <summary>
        /// 文件ID
        /// </summary>
        public long? FileId { get; set; }
    }
}
